import { createRouter, createWebHistory } from "vue-router";
/* Layout */
import Layout from "@/layout/index.vue";

// 公共路由
export const routes = [
  {
    path: "/login",
    component: () => import("@/views/login.vue"),
  },
    
  {
    path: '', // 如果路由为/
    redirect: '/login' //重定向到登录组件
},
  {
    path: '/',
    component: Layout,
    meta: { title: "新疆" },
    name: "supervision",
    children: [
      {
        path: 'supervision',
        component: () => import('@/views/supervision/index.vue'),
        name: 'supervision',
        meta: { title: '滚撮监盘' },
      }
    ]
  }
];

const router = createRouter({
  history: createWebHistory('/trading'), // 使用history模式
  routes: routes,
});

export default router;
